#include <QCoreApplication>
#include <QDir>
#include <QThread>
#include "logmanager.h"
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    LogManager::Config cfg;
    cfg.max_file_size = 1024 * 1024 * 2; // 2MB
    LogManager::init_module("network", cfg);
    cfg.max_files = 5;
    cfg.max_file_size = 1024 * 1024 * 1; // 2MB
    LogManager::init_module("feiji", cfg);
    cfg.max_files = 10;
    cfg.max_file_size = 1024 * 1024 * 0.5; // 2MB
    LogManager::init_module("tanke", cfg);
    while(true)
    {
    LogManager::log("network", spdlog::level::debug, true,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("network", spdlog::level::info, false,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("feiji", spdlog::level::info, true,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("feiji", spdlog::level::warn, true,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("feiji", spdlog::level::trace, true,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("tanke", spdlog::level::debug, false,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("tanke", spdlog::level::info, true,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("tanke", spdlog::level::critical, true,
                          "Fetching data from {}", "https://api.example.com");
    LogManager::log("tanke", spdlog::level::err, true,
                          "Fetching data from {}", "https://api.example.com");
    QThread::msleep(1);
    }
    return a.exec();
}
